#ifndef SPYNET_NET_ACCEPTOR_H_
#define SPYNET_NET_ACCEPTOR_H_

#include "inet_session.h"

namespace Net
{
	class Acceptor
	{
	public:
		Acceptor(boost::asio::io_service& io_service, ushort listen_port);
		~Acceptor();

		void Start();
		void Listen();
		void ListenHandle(boost::system::error_code ec, INetSessionPtr net_session);

	private:
		boost::asio::io_service& io_service_;
		boost::asio::ip::tcp::acceptor acceptor_;
		ushort listen_port_;

		boost::mutex mutex_;
		std::queue<INetSessionPtr> accept_sessions_;
	};
}

#endif
